<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--引入jstl核心标签库,才能使用--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    ArrayList<String> peoples = new ArrayList<>();
    peoples.add("小明");
    peoples.add("小A");
    peoples.add("小B");
    peoples.add("小C");
    peoples.add("小D");
    request.setAttribute("list",peoples);
%>
<%--
var 遍历的每一个变量
items 遍历的对象
begin 开始
end  结束
step 步长
--%>
<c:forEach var="people" items="${list}">
    <c:out value="${people}"/><br/>
</c:forEach>
<hr>
<c:forEach var="people" items="${list}" begin="1" end="3" step="2">
    <c:out value="${people}"/><br/>
</c:forEach>
</body>
</html>
